[Fix] Environment updates delete unrelated settings when agents revise setup - #2430
Draft
roomote-roomote[bot] wants to merge 1 commit into
Draft
[Fix] Environment updates delete unrelated settings when agents revise setup#2430roomote-roomote[bot] wants to merge 1 commit into
roomote-roomote[bot] wants to merge 1 commit into
Conversation
Contributor
| <description>Create the smallest valid Roomote environment YAML from static evidence.</description> | ||
| <actions> | ||
| <action>Produce exactly one initial YAML config.</action> | ||
| <action>For an existing environment, start from its complete current definition and apply only the requested or validation-backed changes. Preserve every unrelated field verbatim, especially `agentInstructions`, `skills`, `manualSkills`, environment variables, MCP servers, services, Docker projects, ports, and setup commands. The update API replaces the full definition, so an omitted field is a deletion; never regenerate an existing definition from repository evidence alone.</action> |
Contributor
There was a problem hiding this comment.
This only protects update tasks that are explicitly given the complete YAML. A task launched inside an existing environment receives sanitizeEnvironmentConfigForPrompt, which deliberately omits env, agentInstructions, skills, manualSkills, and MCP-server settings; manage_environments has no read action, and list_environments returns only ID/name/description. Such a task therefore cannot build the required baseline, but handleUpdateEnvironment will still replace the config if it submits the visible partial definition, deleting the omitted fields. Add a fail-closed path when the complete definition is unavailable (or expose a safe retrieval path) and cover that flow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue
Internal product report; no public issue.
Why this PR exists
An agent updating an existing environment could derive a fresh minimal definition from repository evidence and silently delete unrelated persisted settings. The update API replaces the complete definition, but neither the environment setup workflow nor the tool schema made that destructive omission behavior explicit.
What changed
Impact
Agent-authored environment revisions now preserve unrelated configuration instead of rebuilding a partial replacement. Intentional removals remain possible when they are part of the requested or evidence-backed change.
How it was tested
@roomote/cloud-agentsand@roomote/worker.Checklist
[Fix],[Feat],[Improve],[Refactor],[Docs], or[Chore]followed by a user-facing descriptionpnpm lintandpnpm check-typespass locally (the repository pre-push equivalents and affected-package full type checks passed)pnpm changeset(an equivalent package-scoped patch changeset was added directly)